package com.example.mvvmtest.model.bean;

import android.databinding.BaseObservable;
import android.databinding.Bindable;
import android.support.annotation.NonNull;

import com.android.databinding.library.baseAdapters.BR;

public class UserBean extends BaseObservable {
    private String firstName;
    private String lastName;
    private boolean isStudent;

    public UserBean(String firstName, String lastName, boolean isStudent) {
        this.firstName = firstName;
        this.lastName = lastName;
        this.isStudent = isStudent;
    }

    @Bindable
    public String getFirstName() {
        return this.firstName;
    }

    @Bindable
    public String getLastName() {
        return this.lastName;
    }

    @Bindable
    public boolean isStudent() {
        return this.isStudent;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
        notifyPropertyChanged(BR.lastName);

    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
        notifyPropertyChanged(BR.firstName);

    }

    public void setStudent(boolean isStudent) {
        this.isStudent = isStudent;
    }

    @NonNull
    @Override
    public String toString() {
        return "firstName:" + firstName + "," +
                "lastName:" + lastName + "," +
                "isStudent:" + isStudent;
    }
}
